package com.asen.commons.core.base.service.impl;

import com.asen.commons.core.base.domain.SubBase;
import com.asen.commons.core.base.service.SubBaseService;
import com.asen.commons.core.meta.dao.Condition;
import com.asen.commons.utils.IdUtils;

/**
 * 从属类
 *
 * @author Gary
 * @version 1.0
 * @date 2021-05-07
 */
public class AbstractSubBaseServiceImpl<T extends SubBase> extends AbstractCoreBaseServiceImpl<T> implements SubBaseService<T> {

    @Override
    public T getByParentId(Long parentId) throws Exception {
        if (IdUtils.isEmpty(parentId)) {
            return null;
        }

        Condition condition = new Condition();
        condition.equal("parentId", parentId);
        return getBy(condition);
    }
}
